package com.blackholemax;

import com.blackholemax.structure.MyArray;
import com.blackholemax.structure.MyLinkedList;

public class Main {
    public static void main(String[] args) throws IndexOutOfBoundsException {
        MyArray array = new MyArray(5);
        array.insert(10, 0);
        array.insert(20, 1);
        array.insert(30, 2);
        array.insert(40, 3);
        array.insert(50, 4);
        array.insert(60, 5);
        int delEle = array.delete(1);
        System.out.println(delEle);
        int delEle2 = array.quickDelete(2);
        System.out.println(delEle2);
        System.out.println(array);

        MyLinkedList linkedList = new MyLinkedList();
        linkedList.insert(10, 0);
        linkedList.insert(20, 1);
        linkedList.insert(30, 2);
        linkedList.insert(40, 3);
        linkedList.insert(50, 4);
        MyLinkedList.Node delNode = linkedList.delete(4);
        System.out.println(delNode);
        System.out.println(linkedList);
    }
}